package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class SchemaQualifiedName implements CastTarget, DataType, MemberNameAlternatives, TargetSubtype, TransliterationSource {

    private final SchemaName schemaName;
    private final Identifier qualifiedIdentifier;

    public SchemaQualifiedName(SchemaName schemaName, Identifier qualifiedIdentifier) {
        this.schemaName = schemaName;
        this.qualifiedIdentifier = qualifiedIdentifier;
    }

    public int getBeginIndex() {
        if (schemaName != null) {
            return schemaName.getBeginIndex();
        }
        return qualifiedIdentifier.getBeginIndex();
    }

    public int getEndIndex() {
        return qualifiedIdentifier.getEndIndex();
    }

    public SchemaName getSchemaName() {
        return schemaName;
    }

    public Identifier getQualifiedIdentifier() {
        return qualifiedIdentifier;
    }

}
